if (ScriptEngine <> "VBScript" OR ScriptEngineMajorVersion < 5) then
Response.Write("This script requires VBScript 5.5 or later installed on the web server. Please download the latest Windows Script package from Microsoft and install this on your server, or consult your web host<br />")
Response.End
end if
if (ScriptEngineMajorVersion = 5 AND ScriptEngineMinorVersion < 5 AND AllowExactPhrase = 1) then
Response.Write("This script requires VBScript 5.5 or later installed on the web server. Please download the latest Windows Script package from Microsoft and install this on your server, or consult your web host<br />")
Response.Write("Note that you may be able to run this on VBScript 5.1 if you have Exact Phrase matching disabled.<br />")
Response.End
end if
Function MapPath(path)
on error resume next
IsHSP = Server.IsHSPFile
if (err.Number = 0 AND IsHSP) then
MapPath = Server.MapExternalPath(path) ' for HSP support
else
MapPath = Server.MapPath(path)
end if
on error goto 0
End Function
' Check for dependant files
set fso = CreateObject("Scripting.FileSystemObject")
if (fso.FileExists(MapPath("settings.asp")) = False OR fso.FileExists(MapPath("zoom_wordmap.zdat")) = FALSE OR fso.FileExists(MapPath("zoom_dictionary.zdat")) = FALSE OR fso.FileExists(MapPath("zoom_pages.zdat")) = FALSE OR fso.FileExists(MapPath("zoom_titles.zdat")) = FALSE) then
Response.Write("<b>Zoom files missing error:</b> Zoom is missing one or more of the required index data files.<br />Please make sure the generated index files are uploaded to the same path as this search script.<br />")
if (descriptions(0) = "This file blank due to indexing configuration.") then
Response.Write("<b>Zoom config error:</b> The zoom_descriptions.zdat file is not properly created for the search settings specified.<br />Please check that you have re-indexed your site with the search settings selected in the configuration window.<br />")
if (DisplayContext = 1 OR AllowExactPhrase = 1) then
Dim bin_pagetext
set bin_pagetext = CreateObject("ADODB.Stream")
bin_pagetext.Type = 1 ' stream type = binary
bin_pagetext.Open ' open stream
bin_pagetext.LoadFromFile MapPath("zoom_pagetext.zdat") 'load file to stream
'check for blank message
tmpstr = CStr(bin_pagetext.Read(8))
if (tmpstr = "This") then
Response.Write("<b>Zoom config error:</b> The zoom_pagetext.zdat file is not properly created for the search settings specified.<br />Please check that you have re-indexed your site with the search settings selected in the configuration window.<br />")
' avoid problems with languages with "," as decimal pt breaking log file format.
ElapsedTime = Replace(ElapsedTime, ",", ".")
LogString = LogString & ", Time = " & ElapsedTime
' end of record
LogString = LogString & VbCrLf
on error resume next
set logfile = fso.OpenTextFile(MapPath(LogFileName), 8, True, 0)
if (Err.Number <> 0) then
Response.Write("Unable to write to log file (" & MapPath(LogFileName) & "). Check that you have specified the correct log filename in your Indexer settings and that you have the required file permissions set.<br />")